local wu__shiju = fk.CreateSkill {
  name = "wu__shiju",
}

Fk:loadTranslationTable{
  ["wu__shiju"] = "失惧",
  [":wu__shiju"] = "每回合限一次，你可以失去1点护甲，视为使用一张【无懈可击】。",
  ["#wu__shiju"] = "失惧：失去1点护甲以视为使用一张【无懈可击】",
}

wu__shiju:addEffect("viewas", {
  pattern = "nullification",
  prompt = "#wu__shiju",
  card_filter = Util.FalseFunc,

  interaction = function(self, player)
    local all_names = {"nullification"}
    local names = player:getViewAsCardNames(wu__shiju.name, all_names)
    if #names == 0 then return end
    return UI.CardNameBox {
      choices = names,
      all_choices = all_names
    }
  end,

  view_as = function(self, player, card_id)
    local nullification = Fk:cloneCard(self.interaction.data)
    nullification.skillName = wu__shiju.name
    return nullification
  end,

  before_use = function(self, player, use)
    player.room:changeShield(player, -1)
  end,

  enabled_at_play = function(self, player, response)
    return player:usedSkillTimes(wu__shiju.name, Player.HistoryTurn) == 0 
    and player.shield > 0
  end,

  enabled_at_response = function(self, player, response)
    return player:usedSkillTimes(wu__shiju.name, Player.HistoryTurn) == 0 
    and player.shield > 0
  end,
})

return wu__shiju